#ifndef __FONTMAP__HPP__
#define __FONTMAP__HPP__

#include <string>

#include "type.hpp"


#include <ft2build.h>
#include FT_FREETYPE_H

struct FontChar
{
  uint offset;
  int width;
  int height;
  float top;

  float twidth;
  float theight;

  unsigned char* data_;
  uint dataLength_;
};

typedef FontChar* FontChar_P;
 
class FontMap
{
public:
  FontMap();
  ~FontMap();

  bool Prepare(std::string fontname, uint fontsize);
  FontChar_P getChar(unsigned char ch); 
private:

  FontChar charInfo_[256];
  FT_Library library;
  FT_Face     face; 

};

#endif
